﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace NMLX_Data_Management
{
    public partial class DetailRecord : Form
    {
        private int projectid;
        private int programid;

        public DetailRecord()
        {
            InitializeComponent();
        }

        public DetailRecord(int projectid, int programid)
        {
            InitializeComponent();
            this.projectid = projectid;
            this.programid = programid;
        }

        private void DetailRecord_Load(object sender, EventArgs e)
        {
            // TODO: 这行代码将数据加载到表“nMLX_Data_MDataSet.DetailRecord”中。您可以根据需要移动或删除它。
            DataSet ds = new DataSet();
            string sql = "select * from DetailRecord where ProjectId='" + projectid + "' and ProgramId='"+ programid + "'";
            ds = NMLX.DBUtility.DbHelperOleDb.Query(sql);
            this.dataGridView1.DataSource = ds.Tables[0];
            this.dataGridView1.Refresh();
            //this.dataGridView1.RowsDefaultCellStyle.BackColor = Color.Gray;
            this.dataGridView1.AlternatingRowsDefaultCellStyle.BackColor = Color.Beige;

        }

        private void DetailRecord_FormClosing(object sender, FormClosingEventArgs e)
        {
            this.Hide(); ;
        }
    }
}
